Console messaging optimization and addition of SNMFOptimizer.objective_log#195
Console messaging optimization and addition of SNMFOptimizer.objective_log#195Andrea-gm wants to merge 13 commits intodiffpy:mainfrom
Conversation
Was giving me errors due to use of python 3.11
Optimized print messages Added verbose option Added objective_log attribute to track objective function updates, with associated time stamps and specifying what matrix has been updated
Fixed wrong setting of objective_log
remove commented print messages
Added "iteration" key to objective_log Removed redundant _objective_history attribute
|
I applied my changes to the previous version of the main branch. I am now resolving the conflicts keeping the new modifications implemented in main. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #195 +/- ##
===========================================
- Coverage 77.50% 57.50% -20.00%
===========================================
Files 3 3
Lines 40 40
===========================================
- Hits 31 23 -8
- Misses 9 17 +8 🚀 New features to boost your workflow:
|
|
I updated the attribute nomenclature to match the new version of main, and removed all conflicts arising from versioning. There are now no conflicts with the base branch, but I'm unsure of why the codecov is failing |
|
Thanks Andrea, this looks great. The codecov, I believe, is failing for reasons totally unrelated to your PR. Will let Simon confirm. |
sbillinge
left a comment
There was a problem hiding this comment.
This looks good @Andrea-gm I just had one comment. Thanks for the contributions.
| eta=0, | ||
| random_state=None, | ||
| show_plots=False, | ||
| verbose=True, |
There was a problem hiding this comment.
I think we would normally default verbose to false and set it to true only for debugging.
This PR introduces a structured logging system and adds user control over console output during optimization. The legacy objective history list has been entirely replaced by the new objective log attribute, which stores a detailed history of the optimization process by recording the step, iteration, objective value, and timestamp at each update. Convergence checks and step-size calculations have been refactored to pull directly from this new log, eliminating redundant data tracking. Additionally, a verbose parameter was added to the optimizer initialization to toggle terminal output. All internal print messages have been rewritten for clarity and are now conditionally executed based on this verbose flag.